<?php
/**
 * Created by PhpStorm.
 * User: luzy
 * Date: 2018/7/18
 * Time: 上午10:41
 */



class StatExcel extends Base_Controller
{
    public function __construct()
    {
        parent::__construct();
    }

    public function createWenjuanResultExcel($wenjuanid)
    {
        $this->load->model('wenjuan_excel_model');
        $data = $this->wenjuan_excel_model->getExportData($wenjuanid);
        $this->load->model('excel_model');
        $this->excel_model->createSheet();
        $this->excel_model->setSheetValue(0,'测试结果',$data['body']);
        $this->excel_model->downloadExcel($data['name']);
    }

    public function createWenjuanItemResultExcel($wenjuanid)
    {
        $this->load->model('wenjuan_excel_model');
        $data = $this->wenjuan_excel_model->getChoiceData($wenjuanid);
        $this->load->model('excel_model');
        $this->excel_model->createSheet();
        $this->excel_model->setSheetValue(0,'选项统计',$data['body']);
        $this->excel_model->downloadExcel($data['name']);
    }
}